<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="generator" content="ApiGen; http://apigen.org" />

	<title>Class Nette\Caching\Cache</title>

	<link rel="stylesheet" href="resources/style.css?v=2011071314" type="text/css" media="all" />
	<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
	<link rel="search" href="opensearch.xml" type="application/opensearchdescription+xml" title="Nette Framework API documentation" />
	<script type="text/javascript" src="resources/combined.js"></script>
	<script type="text/javascript" src="allclasses.js"></script>
</head>

<body>
<div id="left">
	<a href="allclasses.html">All Classes</a>

	<h3>Namespaces</h3>
	<ul>
		<li><a href="namespace-none.html">none</a>
		</li>
		<li><a href="namespace-Nette.html">Nette</a>
		</li>
		<li><a href="namespace-Nette.Application.html">Nette\Application</a>
		</li>
		<li class="active"><a href="namespace-Nette.Caching.html">Nette\Caching</a>
		</li>
		<li><a href="namespace-Nette.Collections.html">Nette\Collections</a>
		</li>
		<li><a href="namespace-Nette.Config.html">Nette\Config</a>
		</li>
		<li><a href="namespace-Nette.Forms.html">Nette\Forms</a>
		</li>
		<li><a href="namespace-Nette.IO.html">Nette\IO</a>
		</li>
		<li><a href="namespace-Nette.Loaders.html">Nette\Loaders</a>
		</li>
		<li><a href="namespace-Nette.Mail.html">Nette\Mail</a>
		</li>
		<li><a href="namespace-Nette.Reflection.html">Nette\Reflection</a>
		</li>
		<li><a href="namespace-Nette.Security.html">Nette\Security</a>
		</li>
		<li><a href="namespace-Nette.Templates.html">Nette\Templates</a>
		</li>
		<li><a href="namespace-Nette.Web.html">Nette\Web</a>
		</li>
		<li><a href="namespace-PHP.html">PHP</a>
		</li>
	</ul>

	<hr />

	<h3>Classes</h3>

	<ul>
		<li class="active"><a href="Nette.Caching.Cache.html">Cache</a></li>
		<li><a href="Nette.Caching.DummyStorage.html">DummyStorage</a></li>
		<li><a href="Nette.Caching.FileStorage.html">FileStorage</a></li>
		<li><a href="Nette.Caching.MemcachedStorage.html">MemcachedStorage</a></li>
	</ul>

	<h3>Interfaces</h3>

	<ul>
		<li><a href="Nette.Caching.ICacheStorage.html">ICacheStorage</a></li>
	</ul>

</div>

<div id="right">
	<form action="http://www.google.com/cse" id="search" onsubmit="if(this.q.value.indexOf('more:')==-1)this.q.value+=' more:api'">
		<input type="hidden" name="cx" value="011549293477758430224:vxofa9ufnhc" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" class="text" /><input type="submit" value="Search" />
	</form>

<div id="navigation">
	<ul>
		<li><a href="overview.html" title="Summary of all namespaces">Overview</a></li>
		<li><a href="namespace-Nette.Caching.html" title="Summary of Nette\Caching">Namespace</a></li>
		<li class="active">Class</li>
		<li><a href="elements.html">Elements</a></li>
	</ul>
</div>

<div id="content">
	<div id="classSummary">
		<p>namespace <a href="namespace-Nette.Caching.html">Nette\Caching</a></p>

		<h1>Class Cache</h1>

		<div class="classDescription">
		
<p>Implements the cache for a application.</p>

		</div>

		<dl class="tree">
			<dd style="padding-left:0px">
				<a href="Nette.Object.html">Nette\Object</a>
				
			</dd>
			<dd style="padding-left:30px">
				<img src="resources/inherit.gif" alt="extended by" />
<b>Nette\Caching\Cache</b>				 implements <a href="ArrayAccess.html">ArrayAccess</a>
			</dd>
		</dl>



		<div class="classInfo">
			
				<b>Author:</b> David Grudl<br />
			<b>Located at</b> <a href="source-Caching.Cache.php.html#18">/Caching/Cache.php</a><br />
		</div>
	</div>


	<div id="methodSummary">
		<table class="summary">
		<caption>Method Summary</caption>
		<tr data-order="1 __construct" id="___construct">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#___construct">#</a>
			<code class="nowrap">
				<a href="source-Caching.Cache.php.html#57" title="go to source code"><b>__construct</b></a>(
					<a href="Nette.Caching.ICacheStorage.html">ICacheStorage</a>
					
					<var>$storage</var>, 
					
					<var>$namespace</var> = <span class="php-keyword1">NULL</span>
			)</code>

			<div class="short">
				
			</div>

			<div class="detailed">
				





			</div>
			</td>
		</tr>
		<tr data-order="1 getStorage" id="_getStorage">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				<a href="Nette.Caching.ICacheStorage.html">ICacheStorage</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getStorage">#</a>
			<code class="nowrap">
				<a href="source-Caching.Cache.php.html#70" title="go to source code"><b>getStorage</b></a>(
			)</code>

			<div class="short">
				
<p>Returns cache storage.</p>

			</div>

			<div class="detailed">
				
<p>Returns cache storage.</p>




					<h4>Returns</h4>
					<div class="smallList"><a href="Nette.Caching.ICacheStorage.html">ICacheStorage</a> </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 getNamespace" id="_getNamespace">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				string
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getNamespace">#</a>
			<code class="nowrap">
				<a href="source-Caching.Cache.php.html#81" title="go to source code"><b>getNamespace</b></a>(
			)</code>

			<div class="short">
				
<p>Returns cache namespace.</p>

			</div>

			<div class="detailed">
				
<p>Returns cache namespace.</p>




					<h4>Returns</h4>
					<div class="smallList">string </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 release" id="_release">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				void
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_release">#</a>
			<code class="nowrap">
				<a href="source-Caching.Cache.php.html#92" title="go to source code"><b>release</b></a>(
			)</code>

			<div class="short">
				
<p>Discards the internal cache.</p>

			</div>

			<div class="detailed">
				
<p>Discards the internal cache.</p>






			</div>
			</td>
		</tr>
		<tr data-order="1 save" id="_save">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				mixed
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_save">#</a>
			<code class="nowrap">
				<a href="source-Caching.Cache.php.html#103" title="go to source code"><b>save</b></a>(
					string
					<var>$key</var>, 
					mixed
					<var>$data</var>, 
					array
					
					<var>$dp</var> = <span class="php-keyword1">NULL</span>
			)</code>

			<div class="short">
				
<p>Writes item into the cache.</p>

			</div>

			<div class="detailed">
				
<p>Writes item into the cache.<br>
Dependencies are:</p>

<ul>
	<li>Cache::PRIORITY ⇒ (int) priority</li>

	<li>Cache::EXPIRATION ⇒ (timestamp) expiration</li>

	<li>Cache::SLIDING ⇒ (bool) use sliding expiration?</li>

	<li>Cache::TAGS ⇒ (array) tags</li>

	<li>Cache::FILES ⇒ (array|string) file names</li>

	<li>Cache::ITEMS ⇒ (array|string) cache items</li>

	<li>Cache::CONSTS ⇒ (array|string) cache items</li>
</ul>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$key</code> string key<br />
						<code>$data</code> mixed value<br />
						<code>$dp</code> array dependencies<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">mixed value itself</div>

					<h4>Throws</h4>
					<div class="smallList">
						<a href="InvalidArgumentException.html">InvalidArgumentException</a> <br />
					</div>

			</div>
			</td>
		</tr>
		<tr data-order="1 clean" id="_clean">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				void
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_clean">#</a>
			<code class="nowrap">
				<a href="source-Caching.Cache.php.html#180" title="go to source code"><b>clean</b></a>(
					array
					
					<var>$conds</var> = <span class="php-keyword1">NULL</span>
			)</code>

			<div class="short">
				
<p>Removes items from the cache by conditions.</p>

			</div>

			<div class="detailed">
				
<p>Removes items from the cache by conditions.<br>
Conditions are:</p>

<ul>
	<li>Cache::PRIORITY ⇒ (int) priority</li>

	<li>Cache::TAGS ⇒ (array) tags</li>

	<li>Cache::ALL ⇒ TRUE</li>
</ul>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$conds</code> array <br />
					</div>



			</div>
			</td>
		</tr>
		<tr data-order="1 offsetSet" id="_offsetSet">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				void
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_offsetSet">#</a>
			<code class="nowrap">
				<a href="source-Caching.Cache.php.html#202" title="go to source code"><b>offsetSet</b></a>(
					string
					<var>$key</var>, 
					mixed
					<var>$data</var>
			)</code>

			<div class="short">
				
<p>Inserts (replaces) item into the cache (\ArrayAccess implementation).</p>

			</div>

			<div class="detailed">
				
<p>Inserts (replaces) item into the cache (\ArrayAccess implementation).</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$key</code> string key<br />
						<code>$data</code> mixed <br />
					</div>


					<h4>Throws</h4>
					<div class="smallList">
						<a href="InvalidArgumentException.html">InvalidArgumentException</a> <br />
					</div>

					<h4>Implementation of</h4>
					<div class="smallList"><code><a href="ArrayAccess.html#_offsetSet">ArrayAccess::offsetSet</a></code></div>
			</div>
			</td>
		</tr>
		<tr data-order="1 offsetGet" id="_offsetGet">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				mixed|NULL
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_offsetGet">#</a>
			<code class="nowrap">
				<a href="source-Caching.Cache.php.html#216" title="go to source code"><b>offsetGet</b></a>(
					string
					<var>$key</var>
			)</code>

			<div class="short">
				
<p>Retrieves the specified item from the cache or NULL if the key is not found
(\ArrayAccess implementation).</p>

			</div>

			<div class="detailed">
				
<p>Retrieves the specified item from the cache or NULL if the key is not found
(\ArrayAccess implementation).</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$key</code> string key<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">mixed|NULL </div>

					<h4>Throws</h4>
					<div class="smallList">
						<a href="InvalidArgumentException.html">InvalidArgumentException</a> <br />
					</div>

					<h4>Implementation of</h4>
					<div class="smallList"><code><a href="ArrayAccess.html#_offsetGet">ArrayAccess::offsetGet</a></code></div>
			</div>
			</td>
		</tr>
		<tr data-order="1 offsetExists" id="_offsetExists">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				bool
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_offsetExists">#</a>
			<code class="nowrap">
				<a href="source-Caching.Cache.php.html#239" title="go to source code"><b>offsetExists</b></a>(
					string
					<var>$key</var>
			)</code>

			<div class="short">
				
<p>Exists item in cache? (\ArrayAccess implementation).</p>

			</div>

			<div class="detailed">
				
<p>Exists item in cache? (\ArrayAccess implementation).</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$key</code> string key<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">bool </div>

					<h4>Throws</h4>
					<div class="smallList">
						<a href="InvalidArgumentException.html">InvalidArgumentException</a> <br />
					</div>

					<h4>Implementation of</h4>
					<div class="smallList"><code><a href="ArrayAccess.html#_offsetExists">ArrayAccess::offsetExists</a></code></div>
			</div>
			</td>
		</tr>
		<tr data-order="1 offsetUnset" id="_offsetUnset">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				void
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_offsetUnset">#</a>
			<code class="nowrap">
				<a href="source-Caching.Cache.php.html#252" title="go to source code"><b>offsetUnset</b></a>(
					string
					<var>$key</var>
			)</code>

			<div class="short">
				
<p>Removes the specified item from the cache.</p>

			</div>

			<div class="detailed">
				
<p>Removes the specified item from the cache.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$key</code> string key<br />
					</div>


					<h4>Throws</h4>
					<div class="smallList">
						<a href="InvalidArgumentException.html">InvalidArgumentException</a> <br />
					</div>

					<h4>Implementation of</h4>
					<div class="smallList"><code><a href="ArrayAccess.html#_offsetUnset">ArrayAccess::offsetUnset</a></code></div>
			</div>
			</td>
		</tr>
		<tr data-order="0 checkCallbacks" id="_checkCallbacks">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				bool
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_checkCallbacks">#</a>
			<code class="nowrap">
				<a href="source-Caching.Cache.php.html#269" title="go to source code"><b>checkCallbacks</b></a>(
					array
					<var>$callbacks</var>
			)</code>

			<div class="short">
				
<p>Checks CALLBACKS dependencies.</p>

			</div>

			<div class="detailed">
				
<p>Checks CALLBACKS dependencies.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$callbacks</code> array <br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">bool </div>


			</div>
			</td>
		</tr>

		</table>
	</div>


	<h2>Methods Inherited From <a href="Nette.Object.html#methodSummary">Nette\Object</a></h2>
	<div class="box"><code>
		<a href="Nette.Object.html#_getClass" class="deprecated">getClass()</a>, <a href="Nette.Object.html#_getReflection">getReflection()</a>, <a href="Nette.Object.html#___call">__call()</a>, <a href="Nette.Object.html#___callStatic">__callStatic()</a>, <a href="Nette.Object.html#_extensionMethod">extensionMethod()</a>, <a href="Nette.Object.html#___get">__get()</a>, <a href="Nette.Object.html#___set">__set()</a>, <a href="Nette.Object.html#___isset">__isset()</a>, <a href="Nette.Object.html#___unset">__unset()</a>
	</code></div>


	<div id="constantSummary">
		<table class="summary">
		<caption>Constant Summary</caption>
		<tr data-order="PRIORITY" id="PRIORITY">
			<td align="right" width="1%"><code><b>PRIORITY</b></code></td>
			<td><code><span class="php-quote">'priority'</span></code> <a href="#PRIORITY" class="anchor">#</a></td>
		</tr>
		<tr data-order="EXPIRATION" id="EXPIRATION">
			<td align="right" width="1%"><code><b>EXPIRATION</b></code></td>
			<td><code><span class="php-quote">'expire'</span></code> <a href="#EXPIRATION" class="anchor">#</a></td>
		</tr>
		<tr data-order="EXPIRE" id="EXPIRE">
			<td align="right" width="1%"><code><b>EXPIRE</b></code></td>
			<td><code><span class="php-quote">'expire'</span></code> <a href="#EXPIRE" class="anchor">#</a></td>
		</tr>
		<tr data-order="SLIDING" id="SLIDING">
			<td align="right" width="1%"><code><b>SLIDING</b></code></td>
			<td><code><span class="php-quote">'sliding'</span></code> <a href="#SLIDING" class="anchor">#</a></td>
		</tr>
		<tr data-order="TAGS" id="TAGS">
			<td align="right" width="1%"><code><b>TAGS</b></code></td>
			<td><code><span class="php-quote">'tags'</span></code> <a href="#TAGS" class="anchor">#</a></td>
		</tr>
		<tr data-order="FILES" id="FILES">
			<td align="right" width="1%"><code><b>FILES</b></code></td>
			<td><code><span class="php-quote">'files'</span></code> <a href="#FILES" class="anchor">#</a></td>
		</tr>
		<tr data-order="ITEMS" id="ITEMS">
			<td align="right" width="1%"><code><b>ITEMS</b></code></td>
			<td><code><span class="php-quote">'items'</span></code> <a href="#ITEMS" class="anchor">#</a></td>
		</tr>
		<tr data-order="CONSTS" id="CONSTS">
			<td align="right" width="1%"><code><b>CONSTS</b></code></td>
			<td><code><span class="php-quote">'consts'</span></code> <a href="#CONSTS" class="anchor">#</a></td>
		</tr>
		<tr data-order="CALLBACKS" id="CALLBACKS">
			<td align="right" width="1%"><code><b>CALLBACKS</b></code></td>
			<td><code><span class="php-quote">'callbacks'</span></code> <a href="#CALLBACKS" class="anchor">#</a></td>
		</tr>
		<tr data-order="ALL" id="ALL">
			<td align="right" width="1%"><code><b>ALL</b></code></td>
			<td><code><span class="php-quote">'all'</span></code> <a href="#ALL" class="anchor">#</a></td>
		</tr>
		<tr data-order="REFRESH" id="REFRESH">
			<td align="right" width="1%"><code><b>REFRESH</b></code></td>
			<td><code><span class="php-quote">'sliding'</span></code> <a href="#REFRESH" class="anchor">#</a></td>
		</tr>
		<tr data-order="NAMESPACE_SEPARATOR" id="NAMESPACE_SEPARATOR">
			<td align="right" width="1%"><code><b>NAMESPACE_SEPARATOR</b></code></td>
			<td><code><span class="php-quote">''</span> . <span class="php-quote">&quot;\0&quot;</span> . <span class="php-quote">''</span></code> <a href="#NAMESPACE_SEPARATOR" class="anchor">#</a></td>
		</tr>
		</table>
	</div>





</div>

	<div id="footer">
		Nette Framework API documentation generated by <a href="http://apigen.org">ApiGen</a>
	</div>
</div>
</body>
</html>
